package com.shijimo.file.controller.admin;

import com.shijimo.server.dto.PageDto;
import com.shijimo.server.dto.ResponseDto;
import com.shijimo.server.service.FileService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author Dream_飞翔
 * @email 1072876976@qq.com
 */
@RestController
@RequestMapping("/admin/file")
public class FileController {

    private static final Logger LOG = LoggerFactory.getLogger(FileController.class);
    public static final String BUSINESS_NAME = "";

    @Resource
    private FileService fileService;

    @PostMapping("/list")
    public ResponseDto list(@RequestBody PageDto pageDto) {
        ResponseDto responseDto = new ResponseDto();
        LOG.info("pageDto：{}", pageDto);
        // 进行查询
        fileService.list(pageDto);
        // 设置返回前端的对象，默认成功
        responseDto.setContent(pageDto);
        return responseDto;
    }

}
